<template>
  <div style="text-align: center">
    <img src="../assets/404.png" alt="fail">
    <h2>您访问的页面不存在，{{time}}秒后将返回首页</h2>
    <el-button type="primary" @click="DirectHome">返回首页</el-button>
  </div>

</template>

<script setup>

import {ref} from "vue";
import router from "../router/index.js";

const time = ref(5);
const goHome = setInterval(() => {
  time.value--;
  if(time.value===0){
    clearInterval(goHome)
    window.location.href = '/';
  }
},1000)

const DirectHome = () => {
  clearInterval(goHome)
  window.location.href = '/';
}


</script>
